#include <graph\Graph.hpp>
#include <graph\Scheduler.hpp>


int main( ) {

  using std::list;

  using unitraf::graph_traits::Graph;
  using unitraf::Scheduler;
  
  using unitraf::graph_traits::incidence_list_tag;
  using unitraf::graph_traits::directed_tag;
  using unitraf::graph_traits::no_property_tag;

  typedef unitraf::graph_traits::BusStopProperty bust_stop_property;
  typedef unitraf::graph_traits::StreetSectionProperty street_section_property;

  typedef Graph< 
    bust_stop_property,
    street_section_property,
    incidence_list_tag,
    directed_tag> DGraph;
  
  typedef DGraph::edge_type Edge;
  typedef DGraph::vertex_type Vertex;
  
  enum vertices { A = 0x0, B, C, D, E, F, G, H, J, I, K, L, M, N, O, P };

  Vertex vertex_array[] = {
    Vertex(A, 10.0), Vertex(B, 10.0), Vertex(C, 10.0), Vertex(D, 10.0), 
    Vertex(E, 10.0), Vertex(F, 10.0), Vertex(G, 10.0), Vertex(H, 10.0), 
    Vertex(J, 10.0), Vertex(I, 10.0), Vertex(K, 10.0), Vertex(L, 10.0), 
    Vertex(M, 10.0), Vertex(N, 10.0), Vertex(O, 10.0), Vertex(P, 10.0)
  };

  Edge edge_array[] = {
    Edge(A, B, 5.21), Edge(A, E, 4.41),
    Edge(B, F, 6.17), Edge(B, C, 10.18),
    Edge(C, D, 4.11), Edge(C, G, 8.30),
    Edge(D, H, 13.75),
    Edge(E, F, 5.91), Edge(E, J, 6.11),
    Edge(F, G, 7.01), Edge(F, I, 9.57),
    Edge(G, K, 15.68), Edge(G, H, 7.16),
    Edge(H, L, 7.90),
    Edge(J, I, 6.74), Edge(J, M, 6.89),
    Edge(I, N, 7.84), Edge(I, K, 8.24),
    Edge(K, O, 7.83), Edge(K, L, 7.32),
    Edge(L, P, 10.7),
    Edge(M, N, 9.32),
    Edge(N, O, 8.94),
    Edge(O, P, 7.47)
  };

  DGraph net_graph(vertex_array, vertex_array + sizeof(vertex_array) / sizeof(Vertex),
    edge_array, edge_array + sizeof(edge_array) / sizeof(Edge));

  Scheduler<DGraph> scheduler(net_graph);

  DGraph::model_type::out_vertex_pairii vertices = net_graph.GetOutVertices();
  
    
  Scheduler<DGraph>::routes_list_type routes_list; 

  scheduler._find_routes(vertices.first, vertices.last, P, 7);

  scheduler._assess(routes_list);

  return 0;

};
